Skip to content

feat: wire determinism hooks + add token asymmetry principle#608

Merged
notque merged 2 commits intomainfrom
feat/wire-determinism-hooks
May 8, 2026
Merged

feat: wire determinism hooks + add token asymmetry principle#608
notque merged 2 commits intomainfrom
feat/wire-determinism-hooks

Conversation

@notque
Copy link
Copy Markdown
Owner

@notque notque commented May 8, 2026

Summary

  • Registers 3 hooks in settings.json: instruction-compliance (PostToolUse:Agent), posttool-auto-test (PostToolUse:Write|Edit), pipeline-phase-gate (PreToolUse:Write|Edit)
  • Integrates scripts/pre-route.py into /do SKILL.md Phase 2 Step 0 as deterministic pre-filter before Haiku routing
  • Adds token cost asymmetry principle to PHILOSOPHY.md: "One Opus token costs ~30x one Haiku token. Saving Haiku calls is not a valid justification. Pre-routing's value is determinism, not token savings."

Context

Implements the wiring gap identified during installer compatibility review. The 4 components (PRs #604-607) were merged but not activated. This PR activates them.

Test plan

  • JSON syntax validated on settings.json
  • Install-doctor passes (22/23, pre-existing issue)
  • Verify hooks fire on next session (instruction-compliance on Agent, auto-test on Write/Edit, phase-gate on Write/Edit)

notque added 2 commits May 8, 2026 14:50
Register 3 hooks in settings.json:
- instruction-compliance.py (PostToolUse, Agent) — compliance measurement
- posttool-auto-test.py (PostToolUse, Write|Edit) — auto-test after edits
- pipeline-phase-gate.py (PreToolUse, Write|Edit) — phase gate enforcement

Add deterministic pre-routing Step 0 to /do SKILL.md Phase 2:
- Calls scripts/pre-route.py before Haiku routing agent
- High-confidence matches skip LLM routing entirely
- Low/medium confidence falls through to Haiku as before
Tokens are not fungible. One Opus token costs ~30x one Haiku token.
Optimizations that save cheap Haiku calls while risking expensive Opus
rework loops are net losses. Pre-routing's value is determinism, not
token savings. Phase gates prevent Opus rework, not hook overhead.
@notque notque merged commit 4e480b6 into main May 8, 2026
5 checks passed
@notque notque deleted the feat/wire-determinism-hooks branch May 8, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant